home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (c) 1990-1991, 1994 Silicon Graphics, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that the name of Silicon Graphics may not be used in any advertising or
- * publicity relating to the software without the specific, prior written
- * permission of Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
- * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
- *
- * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
- * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE
- * POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
- // -*- C++ -*-
-
- /*
- * Copyright (C) 1990,91 Silicon Graphics, Inc.
- *
- _______________________________________________________________________
- ______________ S I L I C O N G R A P H I C S I N C . ____________
- |
- | $Revision: 1.1006 $
- |
- | Description:
- | This file contains the class description for the MyColorPatch.
- |
- | Author(s) : Alain Dumesny
- |
- ______________ S I L I C O N G R A P H I C S I N C . ____________
- _______________________________________________________________________
- */
-
- #ifndef _SO_XT_COLOR_PATCH_
- #define _SO_XT_COLOR_PATCH_
-
- #include <Inventor/Xt/SoXtGLWidget.h>
- #include <Inventor/SbColor.h>
-
-
- //////////////////////////////////////////////////////////////////////////////
- //
- // Class: MyColorPatch
- //
- // This class simply draws a 3D looking patch of color.
- //
- //////////////////////////////////////////////////////////////////////////////
-
- // C-api: prefix=SoXtColPatch
- class MyColorPatch : public SoXtGLWidget {
-
- public:
-
- MyColorPatch(
- Widget parent = NULL,
- const char *name = NULL,
- SbBool buildInsideParent = TRUE);
- ~MyColorPatch();
-
- //
- // set/get routines to specify the patch top color
- //
- // C-api: name=setCol
- void setColor(const SbColor &rgb);
- // C-api: name=getCol
- const SbColor & getColor() { return color; }
-
- protected:
-
- // This constructor takes a boolean whether to build the widget now.
- // Subclasses can pass FALSE, then call buildWidget()
- // when they are ready for it to be built.
- SoEXTENDER
- MyColorPatch(
- Widget parent,
- const char *name,
- SbBool buildInsideParent,
- SbBool buildNow);
-
- private:
-
- // redefine to do ColorPatch specific things
- virtual void redraw();
- virtual void sizeChanged(const SbVec2s &newSize);
-
- // local variables
- SbColor color;
-
- // this is called by both constructors
- void constructorCommon(SbBool buildNow);
- };
-
-
- #endif // _SO_XT_COLOR_PATCH_
-